package com.zhouxiaoge.realm;

import org.apache.shiro.authc.*;
import org.apache.shiro.realm.Realm;

/**
 * @author 周明阳
 * mail:gqzmy@outlook.com
 * 时间:2018-03-30 16:56
 */

public class MyRealm1 implements Realm {

    @Override
    public String getName() {
        return "a"; //realm name 为 “a”
    }

    @Override
    public boolean supports(AuthenticationToken token) {
        return token instanceof UsernamePasswordToken;
    }

    @Override
    public AuthenticationInfo getAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
        return new SimpleAuthenticationInfo("zhang", "123", getName()
        );
    }
}
